﻿
using Open.Domain.Abstractions;
using System.ComponentModel.DataAnnotations.Schema;

namespace Open.Product.Domain.Model
{

    [Table("baseproductcategories")]
    public class ProductCategory : IMustHaveTenant, IPassivable
    {

        public long Id { get; set; }
        /// <summary>
        /// 父级主键
        /// </summary>
        public long PId { get; set; }

        /// <summary>
        /// 编号
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 拼音码
        /// </summary>
        public string PyCode { get; set; }

        /// <summary>
        /// 是否标品
        /// </summary>
        public bool IsWhether { get; set; }

        #region 公共字段

        /// <summary>
        /// 排序号
        /// </summary>
        public long Sort { get; set; }

        /// <summary>
        /// 租户ID
        /// </summary>
        public int TenantId { get; set; }

        /// <summary>
        /// 启用 = true
        /// 禁用 = false
        /// </summary>
        public bool IsActive { get; set; }

        /// <summary>
        /// 启用
        /// </summary>
        public void Enable()
        {
            this.IsActive = true;
        }

        /// <summary>
        /// 禁用
        /// </summary>
        public void Disable()
        {
            this.IsActive = false;
        }

        #endregion
    }
}